package org.yue.netty.servlet;

import org.springframework.web.WebApplicationInitializer;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRegistration;

/**
 * Created by root on 4/13/17.
 */
public class NettyWebAppInitializer implements WebApplicationInitializer {
    @Override
    public void onStartup(ServletContext container) throws ServletException {
        ServletRegistration.Dynamic registration = container.addServlet("netty", new NettyDispatcherServlet());
        registration.setLoadOnStartup(1);
        registration.addMapping("/netty/*");
    }
}
